﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@model List<MockSchoolManagement.Mvc.ViewModel.UserRoleViewModel>
@{
    var roleId = ViewBag.roleId;
}
<form method="post">
    <div class="card">
        <div class="card-header">
            <h3>在此角色添加或删除用户</h3>
        </div>
        <div class="card-body">
            @for (int i = 0; i < Model.Count; i++)
            {
                <div class="form-check m-1">
                    <input type="hidden" asp-for="@Model[i].UserId"/>
                    <input type="hidden" asp-for="@Model[i].UserName"/>
                    <input asp-for="@Model[i].IsSelected" class="form-check-input"/>
                    <label class="form-check-label" asp-for="@Model[i].IsSelected">@Model[i].UserName</label>
                </div>
            }
        </div>
        <div class="card-footer">
            <input type="submit" class="btn btn-primary" value="更新"/>
            <a asp-action="EditRole" asp-route-id="@roleId" class="btn btn-primary">取消</a>
        </div>
    </div>
</form>
